package com.my.quartz.hello;

import lombok.extern.slf4j.Slf4j;
import org.quartz.*;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Author ScholarTang
 * @Date 2021/7/13 10:45
 * @Desc 任务类
 */
@Slf4j
//@PersistJobDataAfterExecution  //Job设置为有状态的
public class HelloJob implements Job {
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        JobDataMap mergedJobDataMap = jobExecutionContext.getMergedJobDataMap();
        log.info("[Job执行类]"+new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()) + " | 任务被执行了");
    }
}
